﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
    /// <summary>
    /// ТАБЛИЦА «POSITIONS» - ТОРГОВЫЕ РАЗДЕЛЫ ПОРТФЕЛЕЙ
    /// Ключевые поля: acc_code, place_code
    /// </summary>
    class Positions : INotifyPropertyChanged
    {
        #region Private

        private string _accCode;
        private string _placeCode;
        private string _depoAcc;
        private int _iLastUpdate;

        #endregion

        #region Public

        /// <summary>
        /// Портфель.
        /// </summary>
        public string AccCode
        {
            get { return _accCode; }
            set
            {
                if (_accCode != value)
                    _accCode = value;

                RaisePropertyChanged("AccCode");
            }
        }
        /// <summary>
        /// Код рынка.
        /// </summary>
        public string PlaceCode
        {
            get { return _placeCode; }
            set
            {
                if (_placeCode != value)
                    _placeCode = value;

                RaisePropertyChanged("PlaceCode");
            }
        }
        /// <summary>
        /// ДЕПО счет.
        /// </summary>
        public string DepoAcc
        {
            get { return _depoAcc; }
            set
            {
                if (_depoAcc != value)
                    _depoAcc = value;

                RaisePropertyChanged("DepoAcc");
            }
        }
        /// <summary>
        /// Временная метка последнего обновления.
        /// </summary>
        public int ILastUpdate
        {
            get { return _iLastUpdate; }
            set
            {
                if (_iLastUpdate != value)
                    _iLastUpdate = value;

                RaisePropertyChanged("ILastUpdate");
            }
        }

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
